<script setup lang="ts">
const props = defineProps({
  user: {
    type: Object,
    default: () => ({})
  },
  confirm: {
    type: Boolean,
    default: false
  }
})


</script>

<template>
  <div class="person">
    <el-card shadow="hover">
      <template #header>
        <div class="card-header">
          <div class="left">
            <el-tag type="info" effect="dark" size="small">{{ user.isInsure === 1 ? "医保" : "自费" }}</el-tag>
            <span>{{ user.name }}</span>
          </div>
          <div class="right">
            <slot :row="user"></slot>
          </div>
        </div>
      </template>
      <div class="card-body">
        <el-text>证件类型: {{ user.param?.contactsCertificatesTypeString }}</el-text>
        <el-text>证件号码: {{ user.certificatesNo }}</el-text>
        <el-text>性别: {{ user.sex === 1 ? "男" : "女" }}</el-text>
        <el-text>出生日期: {{ user.birthdate }}</el-text>
        <el-text>手机号码: {{ user.phone }}</el-text>
        <el-text>婚姻状况: {{ user.isMarry === 0 ? "未婚" : "已婚" }}</el-text>
        <el-text>当前地址: {{ user.param?.provinceString }}</el-text>
        <el-text>详细地址: {{ user.param?.fullAddress }}</el-text>
        <div class="confirm" v-if="confirm">已选择</div>
      </div>
    </el-card>
  </div>
</template>

<style scoped lang="scss">
.person {
  width: 30%;
  margin: 10px;
  cursor: pointer;

  .card-header {
    display: flex;
    justify-content: space-between;

    .left {
      display: flex;
      align-items: center;

      span {
        margin-left: 5px;
      }
    }
  }

  .card-body {
    position: relative;
    display: flex;
    flex-direction: column;

    .confirm {
      position: absolute;
      width: 100px;
      height: 100px;
      color: red;
      border-radius: 50%;
      border: 1px dashed red;
      text-align: center;
      line-height: 100px;
      opacity: .2;
      font-weight: 900;
      left: 50%;
      top: 50%;
      transform: translate(-50%, -50%);
    }

    span {
      width: 100%;
      display: block;
      line-height: 30px;
      text-overflow: ellipsis;
      overflow: hidden;
      word-break: break-all;
      white-space: nowrap;
    }
  }
}
</style>
